package cn.mesmile.security.controller;

import cn.mesmile.security.dto.EmployeeInfo;
import cn.mesmile.security.service.IEmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zb
 * @date 2020/4/5 16:32
 * @Description:
 */
@RestController
public class EmployeeController {

    private final IEmployeeService employeeService;

    @Autowired
    public EmployeeController(IEmployeeService employeeService) {
        this.employeeService = employeeService;
    }


    @GetMapping("/getInfo/{username}")
    public EmployeeInfo getEmp(@PathVariable("username")String username){
        return employeeService.getEmpByUsername(username);
    }


}
